﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Script.Serialization;
using OLTS.DATA_SERVICE;
using OLTS.MODEL;

namespace ONTS.WEB.Service
{
    /// <summary>
    /// Summary description for GetEmpDetailService
    /// </summary>
    public class GetEmpDetailService : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            String val = "";
            var _cmd = new Employee_Service();

            foreach (OTS_EMPLOYEE d in _cmd.GetAll())
            {
                if (val != "")
                    val += ";";

                val += d.ID + ":" + d.ID + " : " + d.NAME_TH;
            }
            context.Response.ContentType = "text/html";
            context.Response.Write(new JavaScriptSerializer().Serialize(val));
        }


        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}